import request from '@/utils/request.js'
// 将所有的针对coach的请求，都封装到一个对象中
const coachApi = {
    list(conditions) {
        return request.get('/coach/list', {params: conditions})
    },
    page(conditions) {
        return request.get('/coach/selectByPage', {params: conditions})
    },
    deleteById(id) {
        return request.delete( `/coach/deleteById/${id}`)
    },
    deleteAll(ids) {
        return request.delete( `/coach/deleteAll/${ids}`)
    },
    add(coach) {
        //coach以JSON形式传递到后台，后端使用@RequestBody接收
        return request.post('/coach/add', coach)
    },
    selectById(id) {
        return request.get(`/coach/selectById/${id}`)
    },
    update(coach) {
        return request.put('/coach/update', coach)
    }
}

export default coachApi